<?php
namespace App\Server;
use App\Exceptions\ViewException;

class View{
    //显示模板
    public static function make(string $file,array $var = []){
        $file = 'Views/'.$file.'.blade.php';
        if(!is_file($file)){
            //如果文件不存在的话，就应该抛出异常
            throw new ViewException("模板文件{$file}不存在");
        }
        include $file;
    }
}
